

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>设置我的资料</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="{{ADMIN_PATH}}layui/layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="{{ADMIN_PATH}}layui/layuiadmin/style/admin.css" media="all">
    <style>
        .layui-upload-img{width: 92px; height: 92px; margin: 0 10px 10px 0;}
    </style>
</head>
<body>

<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-header">设置我的资料</div>
                <div class="layui-card-body" pad15>

                    <div class="layui-form" lay-filter="">

                        <div class="layui-col-md12">
                            <div class="layui-card">
                                <div class="layui-card-header">上传多张图片</div>
                                <div class="layui-card-body">
                                    <div class="layui-upload">
                                        <button type="button" class="layui-btn" id="test-upload-more">多图片上传</button>
                                        <blockquote class="layui-elem-quote layui-quote-nm" style="margin-top: 10px;">
                                            预览图：
                                            <div class="layui-upload-list" id="test-upload-more-list"></div>
                                        </blockquote>
                                    </div>
                                </div>
                            </div>
                        </div>

                    </div>

                </div>
            </div>
        </div>
    </div>
</div>

<script src="{{ADMIN_PATH}}layui/layuiadmin/layui/layui.js?{{time()}}"></script>
<script>
    var upload_url='';
    layui.use('upload', function(){
        var $ = layui.jquery;
        var upload = layui.upload;
        //多图片上传
        upload.render({
            elem: '#test-upload-more'
            ,url: '/public/upload/pic'
            ,multiple: true
            ,before: function(obj){
                //预读本地文件示例，不支持ie8

            }
            ,done: function(res){
                if(res.status==200){
                    $('#test-upload-more-list').append('<img src="'+ res.data.token +'" alt="'+ res.data.token +'" class="layui-upload-img">')
                }else{
                    layer.msg("上传失败");
                }

                //上传完毕

            }
        });
    });
</script>
</body>
</html>